package com.cloudm.technician.ui.modules.common.register

import com.cloudm.technician.ui.base.BasePresenter
import com.cloudm.technician.ui.base.BaseView

/**
 * 作者: wesley
 * 时间: 2017/12/14
 * 描述: 注册的协议接口
 */
interface RegisterContract {

    interface View : BaseView {

        fun buildTitleRegister()

        fun buildTitleFindPassword()

        fun setServiceAgreementVisible()

        fun setServiceAgreementGone()

        fun getPhoneNumber(): String?

        fun getVerificationCode(): String?

        fun getPassword(): String?

        fun getPasswordConfirm(): String?

        fun getVerificationCode(phoneNumber: String?, flag: Int)

        fun verificationCodeLoadSuccess(verification: String)

        fun verificationCodeLoadFailure(errorMsg: String)

        fun showInputPhoneNumberMsg()

        fun showPhoneNumberFormatMsg()

        fun showVerificationCodeEmptyMsg()

        fun setBtnVericationEnabled()

        fun setBtnVericationNotEnabled(time: Long)

        fun registerOrFindPassword()

        fun showPasswordEmptyMsg()

        fun showPasswordLengthMsg()

        fun showPasswordNotSameMsg()

        fun showErrorMsg(msg: String)

        fun registerOrFindPasswordSuccess()

        fun showRegisterDialog()

        fun showFindPasswordDialog()

        fun hideDialog()

        fun showUserEmptyMsg()

        fun clearPhoneNumberVisible()

        fun clearPhoneNumberInvisible()

        fun clearPasswordVisible()

        fun clearPasswordInVisible()

        fun clearPasswordConfirmVisible()

        fun clearPasswordConfirmInVisible()

        fun openWebActivity()
    }

    interface Presenter : BasePresenter {

        fun buildViewByFlag(flag: Int)

        fun getVerificationCode(phoneNumber: String?, flag: Int)

        fun countDown(time: Long = 60)

        fun cancelCountDown()

        fun registerOrFindPassword(phoneNumber: String?, verification: String?, password: String?,
                                   confirmPassword: String?, flag: Int)

        fun register(phoneNumber: String, verification: String, password: String)

        fun findPassword(phoneNumber: String, verification: String, password: String)

        fun updateIvClearStatus(type: Int, s: CharSequence?)

        fun updateIvClearStatus(hasFocus: Boolean, flag: Int)
    }
}